﻿namespace QuickTuner
{
    /// <summary>
    /// Provides helper methods to keep the <see cref="StationList" /> tests DRY
    /// </summary>
    public static class StationListHelper
    {
        /// <summary>
        /// Creates a default StationList instance.
        /// </summary>
        public static StationList CreateDefaultInstance()
        {
            return new StationList();
        }

        /// <summary>
        /// Creates a default StationList instance and fill it
        /// with the requested amount of random stations.
        /// </summary>
        /// <returns></returns>
        public static StationList CreateFilledInstance(int count) {
            var instance = CreateDefaultInstance();
            AddSomeStations(instance, count);

            return instance;
        }

        /// <summary>
        /// Make some values of the instance non-default
        /// i.e. not empty or not the default value.
        /// </summary>
        public static StationList ChangeSomeProperties(StationList instance)
        {
            //no property to change at the moment

            return instance;
        }

        /// <summary>
        /// Add some stations to the <see cref="StationList" /> instance.
        /// </summary>
        public static StationList AddSomeStations(StationList instance, int count)
        {
            // add some station
            for (int i = 0; i < count; i++)
                instance.Add(StationHelper.CreateRandomStation());

            return instance;
        }
    }
}